layui.define(['layer'], function (exports) {
	var layer = layui.layer,
		$ = layui.jquery;
	
	//工具类
	var tool = {
		getCheckBox: function (data, keyword) {
			
			if( typeof data != 'object' || typeof keyword != 'string' || JSON.stringify(data) == "{}" || keyword.length == 0) {
				return [];
			}

			var result = [],
			reg =new RegExp("^" + keyword + "\\[\\d\\]$");
			
			_.map(data, function(value, key){
				if(reg.test(key) ){
					result.push(value);
				}
			});

			return result;
		}
	};

	exports("tool", tool);
});